﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.Toaster {
    import flash.events.*;
    import flash.display.*;
    import org.aswing.*;
    import Classes.*;
    import Display.*;
    import Display.aswingui.*;

    public class TickerToaster extends Toaster {

        private var m_message:String;
        private var m_messageText:JTextField;
        private var m_closeButton:JButton;
        private var m_window:JWindow;

        public function TickerToaster(_arg1:String){
            m_duration = 5000;
            this.m_message = _arg1;
            this.draw();
        }
        override public function get displayHeight():Number{
            return (30);
        }
        protected function draw():void{
            this.m_window = new JWindow(this);
            var _local1:JPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
            var _local2:DisplayObject = (new EmbeddedArt.hud_nghbr_notification_ticker() as DisplayObject);
            ASwingHelper.setSizedBackground(_local1, _local2);
            var _local3:JPanel = ASwingHelper.makeFlowJPanel();
            var _local4:Number = TextFieldUtil.getLocaleFontSize(14, 11, null);
            this.m_closeButton = ASwingHelper.makeLittleCloseButton();
            ASwingHelper.prepare(this.m_closeButton);
            this.m_messageText = ASwingHelper.makeTextField("", EmbeddedArt.DEFAULT_FONT_NAME_BOLD, _local4, EmbeddedArt.brownTextColor, 0);
            this.m_messageText.setPreferredWidth(((_local2.width - this.m_closeButton.width) - 10));
            this.m_messageText.setText(this.m_message);
            this.m_closeButton.addEventListener(MouseEvent.MOUSE_UP, this.closeButtonHandler, false, 0, true);
            _local3.appendAll(this.m_messageText, this.m_closeButton);
            ASwingHelper.prepare(_local3);
            _local1.append(_local3);
            ASwingHelper.prepare(_local1);
            this.m_window.setContentPane(_local1);
            this.m_window.show();
            ASwingHelper.prepare(this.m_window);
        }
        private function closeButtonHandler(_arg1:MouseEvent):void{
            close();
        }

    }
}//package Display.Toaster 
